package com.ex.mzwqz.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;

import com.ex.mzwqz.R;

/**
 * Created by xiaguoqiang on 16/10/19.
 */
public abstract class BaseActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTheme(R.style.AppTheme);
        super.onCreate(savedInstanceState);
        setContentView(setContentViewResId());
        initView();
        initData();
        initEvent();
    }

    public void setTitle(String title){
        ((TextView)findViewById(R.id.header_title)).setText(title);
    }

    protected abstract int setContentViewResId();

    protected abstract void initView();

    protected abstract void initData();

    protected abstract void initEvent();

}
